package com.changyou.kf.mock.controller;

import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class IndexController {

    @Resource
    private ApplicationContext applicationContext;

    @Resource
    private ApplicationEventPublisher eventPublisher;

    @Value("${datasource.password}")
    private String dataSourcePwd;

    @Value("${redis.password}")
    private String redisPwd;

    @GetMapping("/")
    public String home(){
        long millis = System.currentTimeMillis();
        System.out.println("dataSourcePwd:"+dataSourcePwd+",redisPwd:"+redisPwd);
        //log.debug("now millis:{}", millis);
        log.info("now millis:{}", millis);
        //log.warn("now millis:{}", millis);
        //log.error("now millis:{}", millis);
        return String.valueOf(millis);
    }
}
